/*
 *  cgi.h
 *
 * A CGI/1.1 library for programs trying to read data requests from
 * a HTTP/1.1 web server using a GET or POST style request.  
 * Supported enctypes are: application/x-www-form-urlencoded and 
 * multipart/form-data.  WARNING: multipart/form-data doesn't support
 * recursivness.  File Uploads are supported, if the form-data was a 
 * file, the location of the temp downloaded file is placed in the the value.
 *
 * Copyright (c) 2004-2006 Karlan Thomas Mitchell<karlanmitchell@gmail.com>
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *         This product includes software developed by
           Karlan Thomas Mitchell<karlanmitchell@gmail.com>
 * 4. Neither Karlan Thomas Mitchell nor the names of its
 *    contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY KARLAN THOMAS MITCHELL AND CONTRIBUTORS
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */


#ifndef _CGI_DECODE_H
#define _CGI_DECODE_H

#include "encode.h"
#include "env.h"
#include "mini_db.h"
#include "portable_socket.h"
#include <sys/types.h>
#include <stdlib.h>
#include "string.h"
#include <stdio.h>


#define cgienviron st_mdb

int cgi_get_getdata(char * buffer, size_t buffer_len);
int cgi_init(struct cgienviron * cgistruct);
int cgi_add_entry(struct cgienviron * cgistruct, char * encoded_entry);
#define cgi_free mdb_free
#define cgi_get  mdb_get
#define cgi_set  mdb_set
#define cgi_set_int  mdb_set_int
#define cgi_print  mdb_print


#endif
